package cn.hznc.configuration;

import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;

@Component
@MessagingGateway(defaultRequestChannel = "mqttOutputChannel")
public interface FirstMqttGatewayConfig {
    boolean sendToMqtt(String payload);  //使用默认Topic
    void sendToMqtt(String payload, @Header(MqttHeaders.TOPIC) String topic);
    boolean sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, @Header(MqttHeaders.QOS) int qos, String payload);
}
